import { request } from "@/utils/service"
import * as User from "./types"

// 获取用户详情
export function getUserInfoApi() {
  return request<User.InfoResponseData>({
    url: "user/get/login",
    method: "get"
  })
}

// 更新用户信息
export function updateUserInfoApi(data: User.VaildUserInfo) {
  return request({
    url: "user/update/my",
    method: "post",
    data
  })
}

// 获取用户简历
export function getResumeFile() {
  return request<User.ResumeFileData>({
    url: "user/profile",
    method: "post"
  })
}

// 获取用户职位期望
export function getWorkExpectationsApi() {
  return request<User.WorkExpectationsData>({
    url: "user/list/detail/my",
    method: "post"
  })
}

// 更新用户职位期望
export function updateWorkExpectationsApi(data: User.WorkExpectationsParmas) {
  return request<ApiResponseData<boolean>>({
    url: "user/update/detail/my",
    method: "post",
    data
  })
}

// 设置已读消息
export function reReadMessage(data: User.ReReadMessageParams) {
  return request({
    url: "message/reread",
    method: "post",
    data
  })
}
